package com.design.patterns.list.factory.methodfactory;

import com.design.patterns.list.factory.Customer;
import com.design.patterns.list.factory.Pizza;

/**
 * 抽象工厂负责实现的过程，把具体实现延缓到子类中
 * 在引进新的产品时，抽象工厂角色就不必做修改只需要新增一个子类实现
 * @author Wangzhiwen
 */
public abstract class OrderPizza {

    public abstract Pizza createPizza(String pizzaName);

    public OrderPizza() {
        Pizza pizza = createPizza(Customer.getPizzaName());
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
    }
}
